package main

import (
	"fmt"
	"time"
)

func fix_shooting(msg_chan chan string) {

	var times = 3
	var t = 1
	for {
		if t <= times {
			msg_chan <- "fixed shooting"
		}
		t++
		time.Sleep(time.Second * 1)
	}
}

func three_point_shooting(msg_chan chan string) {
	var times = 5
	var t = 1
	for {
		if t <= times {
			msg_chan <- "three point shooting"
		}
		t++
		time.Sleep(time.Second * 1)
	}
}

//func count(msg_chan chan string) {
//	for {
//		msg := <-msg_chan
//
//		fmt.Println(msg)
//		time.Sleep(time.Second * 1)
//	}
//}

func main() {
	c := make(chan string)
	c_three := make(chan string)

	go fix_shooting(c)
	go three_point_shooting(c_three)

	go func() {
		for {
			select {
			case msg1 := <-c:
				fmt.Println(msg1)
			case msg2 := <-c_three:
				fmt.Println(msg2)
			case <-time.After(time.Second * 5):
				fmt.Println("timeout check again")
			}
		}
	}()

	var input string
	fmt.Scanln(&input)

}
